<template>
  <div id="app">
    num:{{ this.$store.state.num }} getNum:{{ this.$store.getters.getNum }}
    <button @click="myIncre">增加</button>
    <button @click="myMinus">减少</button>
    <button @click="muAsyncIncre">异步减少</button>

  </div>
</template>

<script>
// import HelloWorld from "./components/HelloWorld.vue";

export default {
  name: "App",
  components: {
    // HelloWorld,
  },
  methods: {
    myIncre() {
      this.$store.commit("incre", 1);
    },
    myMinus() {
      this.$store.commit("minus", 1);
    },
    muAsyncIncre() {
      this.$store.dispatch("asyncIncre", 2);
    },
  },
};
</script>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}
</style>
